import requests from '../util/request'



export const reqInfoPage = (data) => requests({
    url: '/contact/contactInfo/page',
    params: data,
    method: 'get',
})
export const reqInfo = (id) => requests({
    url: `/contact/contactInfo/${id}`,
    method: 'get',
})




export const reqAddInfo = (data) => requests({
    url: `/contact/add/contactInfo`,
    data,
    method: 'post',
})
export const reqUpdateInfo = (data) => requests({
    url: `/contact/update/contactInfo`,
    data,
    method: 'post',
})

export const reqDeleteInfo = (id) => requests({
    url: `/contact/delete/contactInfo/${id}`,
    method: 'delete',
})
export const reqDeleteInfoList = (data) => requests({
    url: `/contact/delete/contactInfo/list`,
    data,
    method: 'delete',
})
















export const reqUpdateName = (name) => requests({
    url: '/user/change/name',
    data: {"name": name},
    method: 'post',
})
export const reqUpdatePhone = (phone) => requests({
    url: '/user/change/phone',
    data: {"phone": phone},
    method: 'post',
})
export const reqUpdateAvatarUrl = (avatarUrl) => requests({
    url: '/user/change/avatarUrl',
    data: {"avatarUrl": avatarUrl},
    method: 'post',
})
export const reqUpdatePassword = (data) => requests({
    url: '/user/change/password',
    data,
    method: 'post',
})
export const reqUpdateEmail = (data) => requests({
    url: `/email/edit/email/`,
    data,
    method: 'post',
})
export const reqEmailCode = (email) => requests({
    // url: '/email/get/code/',
    url: `/email/get/code`,
    params: {email: email},
    method: 'get',
})
export const reqCheckEmail = (data) => requests({
    // url: '/email/get/code/'+email,
    url: `/get/email/check/${data}`,
    method: 'get',
})



export const reqUpdateUserInfo = (data) => requests({
    url: `/user/change/userInfo`,
    data,
    method: 'post',
})
export const reqDelUserInfo = (userId) => requests({
    url: `/user/del/userInfo/${userId}`,
    method: 'delete',
})
export const reqDelUserInfoList = (delUserList) => requests({
    url: `/user/del/userInfo/list`,
    data: {idList: delUserList},
    method: 'delete',
})
